﻿// DlgCallPoint.cpp: 实现文件
//

#include "stdafx.h"
#include "GHCY.h"
#include "DlgCallPoint.h"
#include "afxdialogex.h"


// DlgCallPoint 对话框

IMPLEMENT_DYNAMIC(DlgCallPoint, CDialogEx)

DlgCallPoint::DlgCallPoint(CArray<PointSocket*> * pArr, CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_SELCALLPOINT, pParent)
	, m_pArrSocket(pArr)
	, m_nSelCur(0)
{

}

DlgCallPoint::~DlgCallPoint()
{
}

void DlgCallPoint::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST1, m_list);
	//DDX_LBString(pDX, IDC_LIST1, m_strCall);
}


BEGIN_MESSAGE_MAP(DlgCallPoint, CDialogEx)
	ON_BN_CLICKED(IDOK, &DlgCallPoint::OnBnClickedOk)
END_MESSAGE_MAP()


// DlgCallPoint 消息处理程序


BOOL DlgCallPoint::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	ASSERT(m_pArrSocket);
	size_t length = m_pArrSocket->GetCount();
	ASSERT(length >= 2);
	for (size_t i = 0; i < length; i++)
		m_list.AddString(m_pArrSocket->GetAt(i)->m_strIP);

	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}


void DlgCallPoint::OnBnClickedOk()
{
	m_nSelCur = m_list.GetCurSel();
	EndDialog(IDOK);
}
